from numpy import *

class MatrixUtils():
    def multiplyMatrix(constant, matrix):   
        matrix2 = []
        for number in matrix:
            matrix2.append(constant * number)
        
        return matrix2
    
    def addMatrix(matrix1, matrix2):
        resultMatrix = []
        for i in range(len(matrix1)):
            resultMatrix.append(matrix1[i] + matrix2[i])
        return resultMatrix
    
    def subtractMatrix(matrix1, matrix2):
        resultMatrix = []
        for i in range(len(matrix1)):
            resultMatrix.append(matrix1[i] - matrix2[i])
        return resultMatrix
    
    def rotateMatrix(matrix, degrees):
        resultMatrix = [0,0]
        resultMatrix[0] = matrix[0] * cos(degrees) + matrix[1] * sin(degrees)
        resultMatrix[1] = matrix[1] * cos(degrees) - matrix[0] * sin(degrees)
        
        return resultMatrix
    
   # def normaliseMatrix(matrix):
        
    
    rotateMatrix = staticmethod(rotateMatrix)
    addMatrix = staticmethod(addMatrix)
    multiplyMatrix = staticmethod(multiplyMatrix)
    subtractMatrix = staticmethod(subtractMatrix)